package com.zyf.chapter01.principle.SOLID.SRP;

import com.zyf.chapter01.principle.SOLID.SRP.utils.Gson;

import java.util.Map;

/**
 * 职责更加单一的序列化类，只包含序列化功能
 * @author yifeng
 */
public class Serializer {
	private static final String IDENTIFIER_STRING = "UEUEUE;";
    private Gson gson;
    
    public Serializer() {
    	this.gson = new Gson();
    }
	
    public String Serialize(Map<String, String> object) {
    	StringBuilder textBuilder = new StringBuilder();
        textBuilder.append(IDENTIFIER_STRING);
        textBuilder.append(gson.toJson(object));
        return textBuilder.toString();
    }
}
